package com.hxzy.entity.system;

import java.io.Serializable;
import java.util.Date;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.hxzy.excel.converter.SysNormalDisableConverter;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * @author 
 * 角色信息表
 */
@Data
@TableName(value = "sys_role")
@ExcelIgnoreUnannotated
public class SysRole implements Serializable {
    /**
     * 角色ID
     */
    @ExcelProperty(value = "主键",order = 0)
    @TableId(value = "role_id",type = IdType.AUTO)
    private Long roleId;

    /**
     * 角色名称
     */
    @ExcelProperty(value = "角色名称",order = 1)
    @NotBlank(message = "角色名称不能为空")
    private String roleName;

    /**
     * 角色权限字符串
     */
    @ExcelProperty(value = "角色权限",order = 2)
    @NotBlank(message = "角色权限不能为空")
    private String roleKey;

    /**
     * 显示顺序
     */
    @ExcelProperty(value = "显示顺序",order = 3)
    private Integer roleSort;

    /**
     * 角色状态（0正常 1停用）
     */
    @ExcelProperty(value = "显示顺序",order = 4,converter = SysNormalDisableConverter.class)
    @NotBlank(message = "角色状态不能为空")
    private String status;

    /**
     * 创建者
     */
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    /**
     * 创建时间
     */
    @ExcelProperty(value = "创建时间",order =5)
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新者
     */
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    @TableField(fill = FieldFill.UPDATE)
    private String updateBy;

    /**
     * 更新时间
     */
    @JsonInclude(value = JsonInclude.Include.NON_NULL)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;

    private static final long serialVersionUID = 1L;
}